'''
Created on 24/09/2012

@author: Charles
'''
import unittest
from Subtree import *

class SubtreeTest(unittest.TestCase):


    def setUp(self):
        pass


    def tearDown(self):
        pass


    def testIterator(self):
        test = []
        value = ["help", "now", "you", "what", "off"]
        subtree = Subtree([])
        for item in value:
            subtree.addTree(item)
        for itemSubtree in subtree:
            test.append(itemSubtree)
        self.assertTrue(test == value, "Failure values is {0} instead of {1}".format(test, value))
        self.assertTrue(subtree.getFirst() == "help")

if __name__ == "__main__":
    #import sys;sys.argv = ['', 'Test.testName']
    unittest.main()